// 导入axios实例
import httpRequest from '../request/index'


// 获取全部年度点评列表数据
export function getAllAnnualReviewList() {
    return httpRequest({
        url: '/annualreview/all',
        method: 'get',
    });
}


// 获取年度点评列表数据
export function getAnnualReviewList(vcate) {
    return httpRequest({
        url: `/annualreview?vcate=${vcate}`,
        method: 'get',
    });
}



// 添加年度点评
export function addAnnualReview(annualReview) {
    return httpRequest({
        baseURL: '/admin',
        url: `/annualreview/add`,
        method: 'post',
        data: annualReview,
        headers: { Authorization: window.sessionStorage.getItem('token') }
    });
}


// 编辑年度点评
export function editAnnualReview(id, annualReview) {
    return httpRequest({
        baseURL: '/admin',
        url: `/annualreview/${id}`,
        method: 'put',
        data: annualReview,
        headers: { Authorization: window.sessionStorage.getItem('token') }
    });
}


// 删除年度点评
export function deleteAnnualReview(id) {
    return httpRequest({
        baseURL: '/admin',
        url: `/annualreview/${id}`,
        method: 'delete',
        headers: { Authorization: window.sessionStorage.getItem('token') }
    });
}
